<template>
<div class="main">
    <div class="left">
        <div class="top">
             <el-button type="primary" class="el-icon-edit" @click="dianJi()">新建联系人</el-button>
        </div>
        <div class="middle">
            <el-menu :default-openeds="opened" :default-active='value' @select="changeSidebar">
                <el-submenu index="1">
                    <template slot="title">
                        <span>通讯录</span>
                    </template>
                    <el-menu-item-group>
                        <el-menu-item index="recent"><i class="el-icon-time"></i>最近</el-menu-item>
                    </el-menu-item-group>
                </el-submenu>
            </el-menu>    
        </div>
        <div class="middle2">
            <el-card>
                <p>分类</p>
                <el-input placeholder="通讯录分类">
                    <el-button slot="append" class="btn">新增</el-button>
                </el-input>
            </el-card>
        </div>
        <div class="bottom">
            <el-menu :default-openeds="opened">
                <el-submenu index="1">
                    <template slot="title">
                        <span>类型</span>
                    </template>
                    <el-menu-item-group>
                        <el-menu-item index="1-1"><i class="el-icon-discover"></i>我的通讯录</el-menu-item>
                        <el-menu-item index="1-2"><i class="el-icon-discover"></i>公司通讯录</el-menu-item>
                        <el-menu-item index="1-3"><i class="el-icon-discover"></i>共享通讯录</el-menu-item>
                    </el-menu-item-group>
                </el-submenu>
            </el-menu>    
        </div>
    </div>

    <div class="right">
        <router-view></router-view>
    </div>
</div>
</template>
<script>
export default {
// eslint-disable-next-line vue/multi-word-component-names
name:"",
components:{},
data(){
    return {
        value:'recent',
        opened: ['1'],
    }
    },
    methods:{
        // 点击联系人
        dianJi(){
            this.value='',
            this.$router.push('/home/addressBook/addressBookHome/contacts')
        },
        // 点击文件夹下的子菜单
        changeSidebar(path) {
            this.$router.push(path);
        }
    }
}
</script>
<style lang="less" scoped>
.main{
    display: flex;
    flex-direction: row;
    justify-content: space-between;
}
.left{
    display: flex;
    flex-direction: column;
    width: 30%;
}
.top .el-button{
    width: 100%;
}
.middle{
    margin: 20px 0;
}
.middle2{
    margin-bottom: 20px;
}
.middle2 p{
    font-size: 14px;
    padding-bottom: 20px;
    box-sizing: border-box;
}
.right{
    width: 68%;
    // height: 100px;
    // background-color: rgb(238, 223, 238);
}
.btn{
    background-color: #409EFF !important;
    color: rgb(241, 239, 239) !important;
}
</style>